package com.ruoyi.project.video.chatrooms.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.video.chatrooms.mapper.ChatroomsMapper;
import com.ruoyi.project.video.chatrooms.domain.Chatrooms;
import com.ruoyi.project.video.chatrooms.service.IChatroomsService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 聊天室Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-25
 */
@Service
public class ChatroomsServiceImpl implements IChatroomsService 
{
    @Autowired
    private ChatroomsMapper chatroomsMapper;

    /**
     * 查询聊天室
     * 
     * @param ChatRoomID 聊天室主键
     * @return 聊天室
     */
    @Override
    public Chatrooms selectChatroomsByChatRoomID(Long ChatRoomID)
    {
        return chatroomsMapper.selectChatroomsByChatRoomID(ChatRoomID);
    }

    /**
     * 查询聊天室列表
     * 
     * @param chatrooms 聊天室
     * @return 聊天室
     */
    @Override
    public List<Chatrooms> selectChatroomsList(Chatrooms chatrooms)
    {
        return chatroomsMapper.selectChatroomsList(chatrooms);
    }

    /**
     * 新增聊天室
     * 
     * @param chatrooms 聊天室
     * @return 结果
     */
    @Override
    public int insertChatrooms(Chatrooms chatrooms)
    {
        return chatroomsMapper.insertChatrooms(chatrooms);
    }

    /**
     * 修改聊天室
     * 
     * @param chatrooms 聊天室
     * @return 结果
     */
    @Override
    public int updateChatrooms(Chatrooms chatrooms)
    {
        return chatroomsMapper.updateChatrooms(chatrooms);
    }

    /**
     * 批量删除聊天室
     * 
     * @param ChatRoomIDs 需要删除的聊天室主键
     * @return 结果
     */
    @Override
    public int deleteChatroomsByChatRoomIDs(String ChatRoomIDs)
    {
        return chatroomsMapper.deleteChatroomsByChatRoomIDs(Convert.toStrArray(ChatRoomIDs));
    }

    /**
     * 删除聊天室信息
     * 
     * @param ChatRoomID 聊天室主键
     * @return 结果
     */
    @Override
    public int deleteChatroomsByChatRoomID(Long ChatRoomID)
    {
        return chatroomsMapper.deleteChatroomsByChatRoomID(ChatRoomID);
    }
}
